package com.junzhiit.nengji.shop.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum SystemUserStatus {
	
	ACTIVE(0,"正常"),
	INACTIVE(1,"停用");
	
	private Integer status;
	
	private String value;

	private SystemUserStatus(Integer status,String value){
		this.status = status;
		this.value = value;
	}

	public int toIntStatus() {
		return this.status;
	}
	
	public String toStringValue() {
		return this.value;
	}

	public static SystemUserStatus toFlag(int status) {
		for (SystemUserStatus _status : values()) {
			if(status == _status.toIntStatus()) {
				return _status;
			}
		}
		throw new InvalidArgumentException("Unknown status[" + status + "].");
	}
}
